import Book.BookList;
import User.AdminUser;
import User.NormalUser;
import User.User;
import java.util.Scanner;

public class Main {

    public static User login(){
        System.out.println("请输入你的姓名：");
        Scanner scanner = new Scanner(System.in);
        String username = scanner.nextLine();
        System.out.println("请输入您的身份： 0->管理员 1->读者");
        int choice = scanner.nextInt();
        if(choice == 0){
            return new AdminUser(username);
        }else{
            return new NormalUser(username);
        }
    }

    public static void main(String[] args) {

        BookList bookList = new BookList();
        User user = login();

        while(true){
            int choice = user.meau();
            user.doOperation(choice,bookList);
        }


    }
}
